<template>
	<view class="page">
		<!-- 文章数据 -->
		<mescroll-body ref="mescrollRef" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption"
			:top="0">
			<view class="article-data">
				<view class="article-list">
					<view class="list" v-for="(item,index) in typeOfEntry" :key="index">
						<view class="thumb">
							<image src="https://p3.ssl.qhimgs1.com/sdr/400__/t0485eb72d6fc28e0d9.jpg"></image>
						</view>
						<view class="item">
							<view class="title">
								{{ item.name }}
							</view>
							<view class="titleRight">
								<text class="two-omit" @click="onArticle(item)">去入驻</text>
							</view>
						</view>

					</view>
				</view>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	// 引入mescroll-mixins.js
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin], // 使用mixin
		components: {},
		data() {
			return {
				mescroll: null, // mescroll实例对象 (此行可删,mixins已默认)
				// 下拉刷新的配置(可选, 绝大部分情况无需配置)
				downOption: {},
				// 上拉加载的配置(可选, 绝大部分情况无需配置)
				upOption: {},
				typeOfEntry: [{
					'id': 0,
					'name': '商品广告'
				}, {
					'id': 1,
					'name': '自定义广告'
				}],
			};
		},
		onLoad() {
			// uni.setNavigationBarColor({
			// 	backgroundColor: '#aa55ff',
			// 	animation: {
			// 		duration: 400,
			// 		timingFunc: 'easeIn'
			// 	}
			// })
		},
		methods: {
			callPhone() {
				uni.makePhoneCall({
					phoneNumber: '114' //仅为示例
				});
			},
			/*下拉刷新的回调, 有三种处理方式:*/
			downCallback() {
				this.mescroll.endSuccess();
			},
			/*上拉加载的回调*/
			upCallback(page) {
				setTimeout(() => {
					this.mescroll.endByPage(10, 20);
				}, 2000)
			},
			/**
			 * 入住点击
			 */
			onArticle(rowData) {
				console.log({
					...rowData
				});
				uni.$u.route('/moduleA/customAdvertising/customAdvertising', {
					...rowData
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	@import 'guanggaoruzhu.scss';
</style>